﻿CREATE PROCEDURE [dbo].[proc_Users_GetList_All]

AS
	;WITH list As(Select ROW_NUMBER() OVER (ORDER BY UserId) AS Row,
		UserId,
		UserName,
		Password,
		LCM_pw,
		RTX,
		Email,
		CompanyId,
		ISNULL([DepartmentId],0) AS[DepartmentId], --- 部门ID
		[Name],
		CreateDate,
		IsLockout,
		ISNULL(LastLoginDate,'1900-01-01') As LastLoginDate,
		FailedPasswordAttemptCount,
		ISNULL([UserInRoles],'--') AS [UserInRoles], ---权限参数
		IsDelete,
		Cid,
		rootid
	From aspnet_Users WHERE IsLockout=0 --Where (@CompanyId=0 Or CompanyId=@CompanyId) And (@Stext IS NULL Or [Name] like '%'+@Stext+'%')
	)
	
	Select * From list --Where Row between @StartIndex and @EndIndex
	RETURN
